//
//  CustomTabBarController.m
//  HundPark
//
//  Created by Aguilar Rolando on 2013-03-15.
//  Copyright (c) 2013 ARV IT. All rights reserved.
//

#import "CustomTabBarController.h"
#import "UIColor+HundPark.h"
#import "UIFont+HundPark.h"

@interface CustomTabBarController ()

@end

#define TABBAR_BACKGROUND_IMAGE @"tabbar.png"
#define NAVBAR_BACKGROUND_IMAGE @"navbar.png"


@implementation CustomTabBarController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    // TabBar
    [[UITabBar appearance]setBackgroundImage:[UIImage imageNamed:TABBAR_BACKGROUND_IMAGE]];
    
    // NavBar
    [[UINavigationBar appearance]setBackgroundImage:[UIImage imageNamed:NAVBAR_BACKGROUND_IMAGE]forBarMetrics:UIBarMetricsDefault];
    
    // Barbutton Items
    
    [[UIBarButtonItem appearance] setTintColor:[UIColor dogParkGreen]];
    
    
    
    // Display statusbar
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    
    // Set tabbar text
    [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor grayColor],
                                  UITextAttributeFont:[UIFont dogParkH3] }
                                             forState:UIControlStateNormal];
    
    // Set tabbar item color
    [[UITabBarItem appearance] setTitleTextAttributes:@{
                            UITextAttributeTextColor : [UIColor dogParkGreen]
     }forState:UIControlStateSelected];
    
    // Selected tab icon
    [[UITabBar appearance] setSelectedImageTintColor:[UIColor dogParkGreen]];
    
}


@end
